package cn.by.wms.controller;

import cn.by.wms.service.IoItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import cn.by.wms.entity.*;
import cn.by.wms.service.IoMasterService;

import java.util.List;

/**
 * 入库单头;(206_io_master)控制层
 * @author : heimi
 * @date : 2024-11-28
 */
@RestController
@RequestMapping("/api/io")
public class IoMasterController{
    @Autowired
    private IoMasterService ioMasterService;

    @Autowired
    private IoItemService ioItemService;


    /** 
     * 查询接口 
     */
     @GetMapping
     public List<IoMaster> select(IoMasterQuery query){
        return ioMasterService.select(query);
    }
    
    @PostMapping 
    public Integer insert(@RequestBody IoMaster product){
       return ioMasterService.insert(product);
    }
    
    @PutMapping 
    public Integer update(@RequestBody IoMaster product){
        return ioMasterService.update(product);
    }
    
    @DeleteMapping
    public Integer delete(Integer id){
        return ioMasterService.delete(id);
    }

    /**
     * 查询接口
     */
    @GetMapping("/item")
    public List<IoItem> select(IoItemQuery query){
        return ioItemService.select(query);
    }
//
//    @PostMapping
//    public Integer insert(@RequestBody IoItem product){
//        return ioItemService.insert(product);
//    }
//
//    @PutMapping
//    public Integer update(@RequestBody IoItem product){
//        return ioItemService.update(product);
//    }
//
//    @DeleteMapping
//    public Integer delete(Integer id){
//        return ioItemService.delete(id);
//    }
}